package xyz.xtt;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;

import xyz.xtt.exchange.anno.AnnotationService;

@SpringBootApplication
@EnableAsync
@MapperScan("xyz.xtt.exchange.mapper")
@EnableDiscoveryClient
@EnableFeignClients
public class Application implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	private final AnnotationService annotationService;

	@Autowired
	public Application(AnnotationService annotationService) {
		this.annotationService = annotationService;
	}

	@Override
	public void run(String... args) throws Exception {
		annotationService.printAnnotatedClasses();
	}
}
